

<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>Profile </h1>
    </section>
    <?php $msg=$this->session->flashdata("msg");
          $error=$this->session->flashdata("error");
    
    if($msg!=''){?>
        <div class="alert alert-success alert-dismissable">
                                        <i class="fa fa-check"></i>
                                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                        <?php echo $msg; ?>
                                    </div>
   <?php }
    if($error!=''){ ?> 
     <div class="alert alert-danger alert-dismissable">
                                        <i class="fa fa-ban"></i>
                                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                        <?php echo $error; ?>
                                    </div>   
    <?php } ?>
    <!-- Main content -->
    <div class="content">
        <div class="box">
            <div class="col-xs-12">
                <div class="row">
                    <div class="panel panel-info">
                        <div class="panel-heading">
                            <?php foreach ($user as $data) { ?>
                                <h3 class="panel-title"><?php echo $data->name; ?></h3>
                            </div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-3 col-lg-3 " align="center"> <img hight="180" width="150" src="<?php $img= $data->image; if($img != ''){echo base_url()."images/".$img; }else{ echo base_url()."assets/img/avatar5.png"; } ?>" class="img-circle" alt="User Image">
                                        <form action="<?php echo base_url()?>user/do_upload" method="post" enctype="multipart/form-data">
                                            <input class="btn btn-success btn-sm"  type="file" name="image" size="20" />
                                           
                                            <br />
                                            <input class="btn btn-success btn-sm" type="submit"  name="submit" value="upload" />
                                        </form>
                                    </div>
                                    <div class=" col-md-9 col-lg-9 "> 
                                        <table class="table table-user-information">
                                            <tbody>
                                                <tr>
                                                    <td>User Name:</td>
                                                    <td><?php echo $data->username; ?></td>
                                                </tr>  
                                                <tr>
                                                    <td>Name:</td>
                                                    <td><?php echo $data->name; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>Join date:</td>
                                                    <td><?php echo $data->create_time; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>Gender</td>
                                                    <td><?php echo $data->gender; ?></td>
                                                </tr>

                                                <tr>
                                                <tr>
                                                    <td>Address</td>
                                                    <td><?php echo $data->address; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>Phone</td>
                                                    <td><?php echo $data->phone; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>User Type</td>
                                                    <td><?php echo $data->user_type; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>Email</td>
                                                    <td><?php echo $data->email;
                        } ?></td>
                                            </tr>
                                        </tbody>
                                    </table>

                                    <a href="<?php echo base_url() ?>user/changepassword" class="btn btn-primary">Change Password</a>
                                    <a href="<?php echo base_url()?>user/editown" class="btn btn-primary">Edit Profile</a>

                                </div>
                            </div>
                        </div>          
                    </div>
                </div>
            </div>
        </div>
    </div>
</aside>    

